<?php
require_once('wpfunctions.php');
$file = $_REQUEST['file'];
$contents = file_get_contents(ip_firstFile($file));
$contentType = "text/plain";
if($contents[0] == '[' || $contents[0] == '{') {
  $test_json = json_decode($contents);
  if(is_object($test_json) || is_array($test_json)) {
    $contentType = "application/json";
  }
}
@header("Content-type: $contentType");
echo $contents;
?>